﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CauseTermEvalStu.aspx.cs" Inherits="Credit_Teacher_Reprots_CauseTermEvalStu" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>学分成绩明细</title>
    <link href="../../Common/css/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Common/js/jquery.js"></script>

    <script type="text/javascript" src="../../Common/js/common.js"></script>
    <script type="text/javascript">
        function bodyload(){
            
             show();
        }
        function show(){
            var stype =parseInt(Math.random()*100) %3;
            switch(stype)
            {
                case 0:
                document.getElementById('info').innerText = "你真棒！";
                break;
                case 1:
                document.getElementById('info').innerText = "继续努力哦！";
                break;
                case 2:
                document.getElementById('info').innerText = "加油啊！";
                break;
            }
            
           
            ShowPopForm('Congratulate', 'CongratulateTitle', '');
            setTimeout( "closeCongratulate()",5000); 
        }
        function closeCongratulate(){
            clearInterval("closeCongratulate()");
            ClosePopForm('Congratulate');
        }
    </script>
</head>
<body id="bodyest" style="height: 85%; padding-top: 5px; padding-left: 5px; overflow-y: none; overflow-x: none;" SCROLL="no" onload="bodyload()">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <div class="pageBody">
            <div class="mainWarp">
            <asp:Button class="commonBut" ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" OnClientClick="resizeTable();" style="display:none;"/>
                <div style="overflow-y: auto; overflow-x: none; height: 98%;">
<div id="divTable" style="width:95%;  height:95%; margin:left; overflow: auto;position: relative;">
                    <asp:UpdatePanel ID="upResult" runat="server">
                        <ContentTemplate>
                            <asp:Table ID="tbResult" runat="server" CssClass="useList1" Style="margin-left: 5px;">
                            </asp:Table>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnQuery" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                    </div>
                </div>
                
                 <!-- 鼓励信息 -->
                <div id="Congratulate" class="layoutWarp" style="display: none; width: 340px; height: 168px;">
                    <div class="title">
                        <span id="CongratulateTitle"></span><a title="关闭" onclick="ClosePopForm('Congratulate');">
                            关闭</a>
                    </div>
                    <table border="0" class="layoutTable" style="width:300px; height: 120px;">
                        <tr>
                            <td id="info">
                                你真棒
                            </td>
                       
                        </tr>
                    </table>
                </div>
                <!-- END -->
            </div>
        </div>
    </form>

</body>
<script type="text/javascript" src="../../../Common/js/TableForExport.js"></script>
<script type="text/javascript">
    function getExcel() {
        var cells = GetTableInfo(document.getElementById("<%=tbResult.ClientID %>"));
        if(cells!=null)
        {            
            PageMethods.GetExcel(cells,function(result){
            document.getElementById('downloadf').src = "";
            document.getElementById('downloadf').src = "../../../PostFileBytes.aspx";
            },function(err){alert(err._message);});
        }
    }
</script>
<script language="javascript">
    var currentindex = null;
    var currentasc = false;

    function resizeTable(){
//        var h=0;
//        var w=0;
//        if(document.body.scrollHeight>document.getElementById("bodyest").clientHeight)
//        {
//            h = document.getElementById("bodyest").clientHeight;
//        }
//        else
//        {
//            h = document.body.scrollHeight;
//        }
//        if(document.body.scrollWidth>document.getElementById("bodyest").clientWidth)
//        {
//            w = document.getElementById("bodyest").clientWidth+20;
//        }
//        else
//        {
//            w = document.body.scrollWidth-30;
//        }
//        
//        if(h>0 && w>0)
//        {
//            document.getElementById("divTable").style.height=h+"px";
//            document.getElementById("divTable").style.width=w+"px";
//        }
    }
    
    function sort(index) {
        //debugger;
        if(currentindex == null)
        {
            currentindex = 0;
            //for(var col=0;col<document.getElementById("<%=tbResult.ClientID %>").rows[0].cells.length;col++)
            //{
            currentindex = parseInt( document.getElementById("<%=tbResult.ClientID %>").rows[0].cells.length);
            //}
            currentindex =currentindex-2;
        }
        if(currentindex == index)
        {
            currentasc = !currentasc;
            var objs = document.getElementById("img"+index).getElementsByTagName('img');
            if(objs != null && objs.length > 0)
            {
                var obj = objs[0];
                if(!currentasc)
                {
                    obj.src = "../../Common/images/1.gif";
                }
                else
                {
                    obj.src = "../../Common/images/2.gif";
                }
            }
            SortTableCell(document.getElementById("<%=tbResult.ClientID %>"),currentindex,currentasc,1,0, 0);
        }
        else
        {
            var str = document.getElementById("img"+currentindex).innerHTML;
            document.getElementById("img"+index).innerHTML=str;
            document.getElementById("img"+currentindex).innerHTML="";
            currentindex = index;
            SortTableCell(document.getElementById("<%=tbResult.ClientID %>"),currentindex,false,1,0, 0);
        }
    }
    
</script>
</html>
